package com.ruoyi.refund.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.refund.mapper.RefundOrderMapper;
import com.ruoyi.refund.domain.RefundOrder;
import com.ruoyi.refund.service.IRefundOrderService;

/**
 * 退款订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-09
 */
@Service
public class RefundOrderServiceImpl implements IRefundOrderService 
{
    @Autowired
    private RefundOrderMapper refundOrderMapper;

    /**
     * 查询退款订单
     * 
     * @param id 退款订单主键
     * @return 退款订单
     */
    @Override
    public RefundOrder selectRefundOrderById(Long id)
    {
        return refundOrderMapper.selectRefundOrderById(id);
    }

    /**
     * 查询退款订单列表
     * 
     * @param refundOrder 退款订单
     * @return 退款订单
     */
    @Override
    public List<RefundOrder> selectRefundOrderList(RefundOrder refundOrder)
    {
        return refundOrderMapper.selectRefundOrderList(refundOrder);
    }

    /**
     * 新增退款订单
     * 
     * @param refundOrder 退款订单
     * @return 结果
     */
    @Override
    public int insertRefundOrder(RefundOrder refundOrder)
    {
        refundOrder.setCreateTime(DateUtils.getNowDate());
        return refundOrderMapper.insertRefundOrder(refundOrder);
    }

    /**
     * 修改退款订单
     * 
     * @param refundOrder 退款订单
     * @return 结果
     */
    @Override
    public int updateRefundOrder(RefundOrder refundOrder)
    {
        refundOrder.setUpdateTime(DateUtils.getNowDate());
        return refundOrderMapper.updateRefundOrder(refundOrder);
    }

    /**
     * 批量删除退款订单
     * 
     * @param ids 需要删除的退款订单主键
     * @return 结果
     */
    @Override
    public int deleteRefundOrderByIds(Long[] ids)
    {
        return refundOrderMapper.deleteRefundOrderByIds(ids);
    }

    /**
     * 删除退款订单信息
     * 
     * @param id 退款订单主键
     * @return 结果
     */
    @Override
    public int deleteRefundOrderById(Long id)
    {
        return refundOrderMapper.deleteRefundOrderById(id);
    }
}
